﻿using System;
using System.Collections.Generic;
using System.Web;
using He.Web.UI;

namespace He.Web.tools
{
    /// <summary>
    /// save_category_ajax 的摘要说明
    /// </summary>
    public class save_category_ajax : He.Web.UI.AjaxHandler
    {

        public override void ProcessRequest(HttpContext context)
        {
            UI.Manage bk = new UI.Manage();
            if (!bk.IsAdminLogin())
            {
                EchoJson(0, "您还未登陆，请先登陆");
                return;
            }
            int channel_id;
            int to_category_id;
            int id;
            if (!int.TryParse(InputUtil.Form("channel_id"), out channel_id))
            {
                return;
            }
            if (!int.TryParse(InputUtil.Form("to_category_id"), out to_category_id))
            {
                return;
            }
            if (!int.TryParse(InputUtil.Form("id"), out id))
            {
                return;
            }
            Model.channel smodel = new BLL.channel().GetModelByCache(channel_id);
            new BLL.article().UpdateField(id, "category_id=" + to_category_id + "");
        }

        public override bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}